package com.java1412.service;

import com.java1412.utils.CommonResult;
import com.sun.tracing.dtrace.ProviderAttributes;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @author java1412
 * @create 2022-09-02 8:41
 */
@Component
@FeignClient(value = "CLOUD-PAYMENT-SERVICE") // 使用feign远程调用，value表示服务提供者在注册中注册名称
public interface PaymentFeignService {
    // 直接赋值服务提供者中控制器地址
    @GetMapping("/payment/get/{id}")
    public CommonResult getPaymentById(@PathVariable("id") Long id);

    // 模拟超时接口
    @GetMapping("/payment/feign/timeout")
    public String paymentFeignTimeout();
}
